package com.iteaj.network.test.server.line.protocol;

import com.iteaj.network.server.component.LineBasedFrameDecoderComponentAdapter;
import com.iteaj.network.server.protocol.ClientInitiativeProtocol;
import com.iteaj.network.test.MessageCreator;
import com.iteaj.network.test.TestProtocolType;
import com.iteaj.network.test.server.line.LineTestMessage;

/**
 * 测试{@link LineBasedFrameDecoderComponentAdapter}组件
 * 属于客户端主动请求服务端请求协议
 * @see TestProtocolType#CIReq
 */
public class LineDeviceRequestProtocol extends ClientInitiativeProtocol<LineTestMessage> {

    public LineDeviceRequestProtocol(LineTestMessage requestMessage) {
        super(requestMessage);
    }

    @Override
    protected LineTestMessage doBuildResponseMessage() {
        return MessageCreator.lineBuild(getEquipCode(), TestProtocolType.CIReq, requestMessage());
    }

    @Override
    protected void doBuildRequestMessage(LineTestMessage requestMessage) {
        byte[] message = requestMessage.getMessage();
    }


    @Override
    public TestProtocolType protocolType() {
        return TestProtocolType.CIReq;
    }
}
